
Obj/FWlib_apt32f172_i2c.o:     file format elf32-csky-little


Disassembly of section .text:

00000000 <I2C_DeInit>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_DeInit(void)
{
    I2C0->ECR   = I2C_RESET_VALUE;
   0:	1067      	lrw      	r3, 0	// 1c <I2C_DeInit+0x1c>
   2:	3200      	movi      	r2, 0
   4:	9360      	ld.w      	r3, (r3, 0)
   6:	b354      	st.w      	r2, (r3, 0x50)
    I2C0->DCR   = I2C_RESET_VALUE;
   8:	b355      	st.w      	r2, (r3, 0x54)
    I2C0->CR    = I2C_RESET_VALUE;
   a:	b358      	st.w      	r2, (r3, 0x60)
    I2C0->MR    = I2C_RESET_VALUE;
   c:	b359      	st.w      	r2, (r3, 0x64)
    I2C0->IER   = I2C_RESET_VALUE;
   e:	b35d      	st.w      	r2, (r3, 0x74)
    I2C0->IDR   = I2C_RESET_VALUE;
  10:	b35e      	st.w      	r2, (r3, 0x78)
    I2C0->DAT   = I2C_RESET_VALUE;
  12:	237f      	addi      	r3, 128
  14:	b340      	st.w      	r2, (r3, 0)
    I2C0->ADR   = I2C_RESET_VALUE;
  16:	b341      	st.w      	r2, (r3, 0x4)
    I2C0->THOLD = I2C_RESET_VALUE;
  18:	b342      	st.w      	r2, (r3, 0x8)
}  
  1a:	783c      	rts
  1c:	00000000 	.long	0x00000000

00000020 <I2C_Master_Init>:
//MR_u32：Frequency/（MR_u32+4）=I2C clk
//thold_u32：hold/setup time=thold_u32*PCLK
//ReturnValue:NONE
/*************************************************************/
void I2C_Master_Init(I2C_IO_TypeDef I2C_IO, I2C_MODE_TypeDef I2C_MDOE,U16_T MR_u32, U8_T thold_u32)
{
  20:	14c2      	push      	r4-r5
    if (I2C_IO==I2C_G0)
  22:	3840      	cmpnei      	r0, 0
  24:	0821      	bt      	0x66	// 66 <I2C_Master_Init+0x46>
    {
    GPIOA0->CONHR = (GPIOA0->CONHR&0XFFFFFF00)  | 0x00000055;            //PA0.9->SDA, PA0.8->SCL
  26:	1305      	lrw      	r0, 0	// 1b8 <I2C_AcknowledgeConfig+0x10>
  28:	35ff      	movi      	r5, 255
  2a:	9080      	ld.w      	r4, (r0, 0)
  2c:	9401      	ld.w      	r0, (r4, 0x4)
  2e:	6815      	andn      	r0, r5
  30:	3555      	movi      	r5, 85
  32:	6c14      	or      	r0, r5
  34:	b401      	st.w      	r0, (r4, 0x4)
    }
    else if(I2C_IO==I2C_G2)
    {
    GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000770;            //PA1.1->SDA, PA1.2->SCL   
    }
    I2C0->ECR = I2C_I2C;                                                //Enable I2C clock
  36:	1302      	lrw      	r0, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
  38:	3402      	movi      	r4, 2
  3a:	9000      	ld.w      	r0, (r0, 0)
  3c:	b094      	st.w      	r4, (r0, 0x50)
	I2C0->CR = I2C_SWRST;                                               //I2C Generate a software reset
    if (I2C_MDOE==FAST_MODE)
  3e:	3941      	cmpnei      	r1, 1
	I2C0->CR = I2C_SWRST;                                               //I2C Generate a software reset
  40:	3401      	movi      	r4, 1
  42:	b098      	st.w      	r4, (r0, 0x60)
    if (I2C_MDOE==FAST_MODE)
  44:	0804      	bt      	0x4c	// 4c <I2C_Master_Init+0x2c>
    {    
    I2C0->MR = MR_u32+0X1000;                                           //76KHz @PCLK 24MHz  e.g:24000000/(0x138+4)=76000   MR_u32=0x138            
  46:	3180      	movi      	r1, 128
  48:	4125      	lsli      	r1, r1, 5
  4a:	6084      	addu      	r2, r1
    }                                                                   //I2C pre-scalar，and ，mode select
    else I2C0->MR = MR_u32;
  4c:	b059      	st.w      	r2, (r0, 0x64)
    I2C0->THOLD = thold_u32;                                            //I2C Hold/Setup delays
  4e:	3280      	movi      	r2, 128
  50:	6080      	addu      	r2, r0
  52:	b262      	st.w      	r3, (r2, 0x8)
    I2C0->IER = I2C_IER_MASK;                                           //Enable Si interrupt
  54:	3310      	movi      	r3, 16
  56:	b07d      	st.w      	r3, (r0, 0x74)
	I2C0->CR = I2C_ENA;                                                 //Enable I2C
  58:	3380      	movi      	r3, 128
  5a:	4361      	lsli      	r3, r3, 1
  5c:	b078      	st.w      	r3, (r0, 0x60)
	I2CMode=1;
  5e:	3201      	movi      	r2, 1
  60:	1278      	lrw      	r3, 0	// 1c0 <I2C_AcknowledgeConfig+0x18>
  62:	a340      	st.b      	r2, (r3, 0)
}
  64:	1482      	pop      	r4-r5
    else if(I2C_IO==I2C_G1)
  66:	3841      	cmpnei      	r0, 1
  68:	080c      	bt      	0x80	// 80 <I2C_Master_Init+0x60>
    GPIOA0->CONLR = (GPIOA0->CONLR&0XFFF00FFF)  | 0x00066000;            //PA0.4->SDA, PA0.3->SCL
  6a:	1214      	lrw      	r0, 0	// 1b8 <I2C_AcknowledgeConfig+0x10>
  6c:	34ff      	movi      	r4, 255
  6e:	90a0      	ld.w      	r5, (r0, 0)
  70:	448c      	lsli      	r4, r4, 12
  72:	9500      	ld.w      	r0, (r5, 0)
  74:	6811      	andn      	r0, r4
  76:	34cc      	movi      	r4, 204
  78:	448b      	lsli      	r4, r4, 11
    GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000770;            //PA1.1->SDA, PA1.2->SCL   
  7a:	6c10      	or      	r0, r4
  7c:	b500      	st.w      	r0, (r5, 0)
  7e:	07dc      	br      	0x36	// 36 <I2C_Master_Init+0x16>
    else if(I2C_IO==I2C_G2)
  80:	3842      	cmpnei      	r0, 2
  82:	0bda      	bt      	0x36	// 36 <I2C_Master_Init+0x16>
    GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000770;            //PA1.1->SDA, PA1.2->SCL   
  84:	1210      	lrw      	r0, 0	// 1c4 <I2C_AcknowledgeConfig+0x1c>
  86:	34ff      	movi      	r4, 255
  88:	90a0      	ld.w      	r5, (r0, 0)
  8a:	4484      	lsli      	r4, r4, 4
  8c:	9500      	ld.w      	r0, (r5, 0)
  8e:	6811      	andn      	r0, r4
  90:	34ee      	movi      	r4, 238
  92:	4483      	lsli      	r4, r4, 3
  94:	07f3      	br      	0x7a	// 7a <I2C_Master_Init+0x5a>

00000096 <I2C_Slave_Init>:
//thold_u32：hold/setup time=thold_u32*PCLK
//adr_u8：slave address （bit1~bit7）
//ReturnValue:NONE
/*************************************************************/
void I2C_Slave_Init(I2C_IO_TypeDef I2C_IO,I2C_MODE_TypeDef I2C_MDOE, U16_T MR_u32, U8_T thold_u32,U8_T adr_u8)
{
  96:	14c3      	push      	r4-r6
     if (I2C_IO==I2C_G0)
  98:	3840      	cmpnei      	r0, 0
{
  9a:	d88e000c 	ld.b      	r4, (sp, 0xc)
     if (I2C_IO==I2C_G0)
  9e:	0827      	bt      	0xec	// ec <I2C_Slave_Init+0x56>
    {
    GPIOA0->CONHR = (GPIOA0->CONHR&0XFFFFFF00)  | 0x00000055;            //PA0.9->SDA, PA0.8->SCL
  a0:	1206      	lrw      	r0, 0	// 1b8 <I2C_AcknowledgeConfig+0x10>
  a2:	36ff      	movi      	r6, 255
  a4:	90a0      	ld.w      	r5, (r0, 0)
  a6:	9501      	ld.w      	r0, (r5, 0x4)
  a8:	6819      	andn      	r0, r6
  aa:	3655      	movi      	r6, 85
  ac:	6c18      	or      	r0, r6
  ae:	b501      	st.w      	r0, (r5, 0x4)
    }
    else if(I2C_IO==I2C_G2)
    {
    GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000770;            //PA1.1->SDA, PA1.2->SCL   
    }
    I2C0->ECR = I2C_I2C;                                //Enable I2C clock
  b0:	1203      	lrw      	r0, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
  b2:	3502      	movi      	r5, 2
  b4:	9000      	ld.w      	r0, (r0, 0)
  b6:	b0b4      	st.w      	r5, (r0, 0x50)
	I2C0->CR = I2C_SWRST;                               //I2C Generate a software reset
     if (I2C_MDOE==FAST_MODE)
  b8:	3941      	cmpnei      	r1, 1
	I2C0->CR = I2C_SWRST;                               //I2C Generate a software reset
  ba:	3501      	movi      	r5, 1
  bc:	b0b8      	st.w      	r5, (r0, 0x60)
     if (I2C_MDOE==FAST_MODE)
  be:	0804      	bt      	0xc6	// c6 <I2C_Slave_Init+0x30>
    {    
    I2C0->MR = MR_u32+0X1000;                           //76KHz @PCLK 20MHz  e.g:20000000/(MR_u32+4)=76000   MR_u32=0x103         
  c0:	3180      	movi      	r1, 128
  c2:	4125      	lsli      	r1, r1, 5
  c4:	6084      	addu      	r2, r1
    }                                                   //I2C pre-scalar，and ，mode select
    else I2C0->MR = MR_u32;
  c6:	b059      	st.w      	r2, (r0, 0x64)
    I2C0->THOLD = thold_u32;                            //I2C Hold/Setup delays
  c8:	3280      	movi      	r2, 128
  ca:	6080      	addu      	r2, r0
  cc:	b262      	st.w      	r3, (r2, 0x8)
    I2C0->ADR = adr_u8;
    I2C0->IER = I2C_IER_MASK;                           //Enable Si interrupt
  ce:	3310      	movi      	r3, 16
    I2C0->ADR = adr_u8;
  d0:	b281      	st.w      	r4, (r2, 0x4)
    I2C0->IER = I2C_IER_MASK;                           //Enable Si interrupt
  d2:	b07d      	st.w      	r3, (r0, 0x74)
    I2C0->CR = I2C0->CR | I2C_STA_SLAVE;                //I2C as Slave
  d4:	9078      	ld.w      	r3, (r0, 0x60)
  d6:	b078      	st.w      	r3, (r0, 0x60)
	I2C0->CR = I2C0->CR | I2C_ENA;                      //Enable I2C
  d8:	9078      	ld.w      	r3, (r0, 0x60)
  da:	3ba8      	bseti      	r3, r3, 8
  dc:	b078      	st.w      	r3, (r0, 0x60)
    I2C0->CR = I2C0->CR | I2C_AA;
  de:	9078      	ld.w      	r3, (r0, 0x60)
  e0:	3ba1      	bseti      	r3, r3, 1
  e2:	b078      	st.w      	r3, (r0, 0x60)
	I2CMode=0;
  e4:	3200      	movi      	r2, 0
  e6:	1177      	lrw      	r3, 0	// 1c0 <I2C_AcknowledgeConfig+0x18>
  e8:	a340      	st.b      	r2, (r3, 0)
}
  ea:	1483      	pop      	r4-r6
    else if(I2C_IO==I2C_G1)
  ec:	3841      	cmpnei      	r0, 1
  ee:	080c      	bt      	0x106	// 106 <I2C_Slave_Init+0x70>
    GPIOA0->CONLR = (GPIOA0->CONLR&0XFFF00FFF)  | 0x00066000;            //PA0.4->SDA, PA0.3->SCL
  f0:	1112      	lrw      	r0, 0	// 1b8 <I2C_AcknowledgeConfig+0x10>
  f2:	36ff      	movi      	r6, 255
  f4:	90a0      	ld.w      	r5, (r0, 0)
  f6:	46cc      	lsli      	r6, r6, 12
  f8:	9500      	ld.w      	r0, (r5, 0)
  fa:	6819      	andn      	r0, r6
  fc:	36cc      	movi      	r6, 204
  fe:	46cb      	lsli      	r6, r6, 11
    GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000770;            //PA1.1->SDA, PA1.2->SCL   
 100:	6c18      	or      	r0, r6
 102:	b500      	st.w      	r0, (r5, 0)
 104:	07d6      	br      	0xb0	// b0 <I2C_Slave_Init+0x1a>
    else if(I2C_IO==I2C_G2)
 106:	3842      	cmpnei      	r0, 2
 108:	0bd4      	bt      	0xb0	// b0 <I2C_Slave_Init+0x1a>
    GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000770;            //PA1.1->SDA, PA1.2->SCL   
 10a:	110f      	lrw      	r0, 0	// 1c4 <I2C_AcknowledgeConfig+0x1c>
 10c:	36ff      	movi      	r6, 255
 10e:	90a0      	ld.w      	r5, (r0, 0)
 110:	46c4      	lsli      	r6, r6, 4
 112:	9500      	ld.w      	r0, (r5, 0)
 114:	6819      	andn      	r0, r6
 116:	36ee      	movi      	r6, 238
 118:	46c3      	lsli      	r6, r6, 3
 11a:	07f3      	br      	0x100	// 100 <I2C_Slave_Init+0x6a>

0000011c <I2C_Enable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_Enable(void)
{
    I2C0->CR = I2C0->CR | I2C_ENABLE;
 11c:	1168      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
 11e:	9340      	ld.w      	r2, (r3, 0)
 120:	9278      	ld.w      	r3, (r2, 0x60)
 122:	3ba8      	bseti      	r3, r3, 8
 124:	b278      	st.w      	r3, (r2, 0x60)
}
 126:	783c      	rts

00000128 <I2C_Disable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_Disable(void)
{
    I2C0->CR = I2C0->CR | I2C_DISABLE;
 128:	1165      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
 12a:	9360      	ld.w      	r3, (r3, 0)
 12c:	9358      	ld.w      	r2, (r3, 0x60)
 12e:	b358      	st.w      	r2, (r3, 0x60)
}
 130:	783c      	rts

00000132 <I2C_Int_Enable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_Int_Enable(void)
{
    I2C0->CR = I2C0->CR & (~I2C_SI);					//clear I2C INT status
 132:	1163      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
 134:	9340      	ld.w      	r2, (r3, 0)
 136:	9278      	ld.w      	r3, (r2, 0x60)
 138:	3b84      	bclri      	r3, r3, 4
 13a:	b278      	st.w      	r3, (r2, 0x60)
	INTC_ISER_WRITE(I2C_INT);                             //Enable I2C interrupt
 13c:	3280      	movi      	r2, 128
 13e:	1163      	lrw      	r3, 0	// 1c8 <I2C_AcknowledgeConfig+0x20>
 140:	424a      	lsli      	r2, r2, 10
 142:	9360      	ld.w      	r3, (r3, 0)
 144:	23ff      	addi      	r3, 256
 146:	b340      	st.w      	r2, (r3, 0)
}
 148:	783c      	rts

0000014a <I2C_Int_Disable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_Int_Disable(void)
{
    INTC_ICER_WRITE(I2C_INT);                             //Disable I2C interrupt
 14a:	1160      	lrw      	r3, 0	// 1c8 <I2C_AcknowledgeConfig+0x20>
 14c:	32c0      	movi      	r2, 192
 14e:	9360      	ld.w      	r3, (r3, 0)
 150:	4241      	lsli      	r2, r2, 1
 152:	60c8      	addu      	r3, r2
 154:	3280      	movi      	r2, 128
 156:	424a      	lsli      	r2, r2, 10
 158:	b340      	st.w      	r2, (r3, 0)
}
 15a:	783c      	rts

0000015c <I2C_WakeUp_Enable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_WakeUp_Enable(void)
{
    INTC_IWER_WRITE(I2C_INT);                             //Enable I2C wake up
 15c:	107b      	lrw      	r3, 0	// 1c8 <I2C_AcknowledgeConfig+0x20>
 15e:	3280      	movi      	r2, 128
 160:	9360      	ld.w      	r3, (r3, 0)
 162:	23ff      	addi      	r3, 256
 164:	424a      	lsli      	r2, r2, 10
 166:	b350      	st.w      	r2, (r3, 0x40)
}
 168:	783c      	rts

0000016a <I2C_WakeUp_Disable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_WakeUp_Disable(void)
{
    INTC_IWDR_WRITE(I2C_INT);                             //Disable I2C wake up
 16a:	1078      	lrw      	r3, 0	// 1c8 <I2C_AcknowledgeConfig+0x20>
 16c:	32e0      	movi      	r2, 224
 16e:	9360      	ld.w      	r3, (r3, 0)
 170:	4241      	lsli      	r2, r2, 1
 172:	60c8      	addu      	r3, r2
 174:	3280      	movi      	r2, 128
 176:	424a      	lsli      	r2, r2, 10
 178:	b340      	st.w      	r2, (r3, 0)
}
 17a:	783c      	rts

0000017c <I2C_GenerateSTART>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_GenerateSTART(void)
{
    I2C0->CR = I2C0->CR | I2C_STA;
 17c:	1070      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
 17e:	9340      	ld.w      	r2, (r3, 0)
 180:	9278      	ld.w      	r3, (r2, 0x60)
 182:	3ba3      	bseti      	r3, r3, 3
 184:	b278      	st.w      	r3, (r2, 0x60)
}
 186:	783c      	rts

00000188 <I2C_GenerateSTOP>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_GenerateSTOP(void)
{
    I2C0->CR = I2C0->CR | I2C_STO;
 188:	106d      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
 18a:	9340      	ld.w      	r2, (r3, 0)
 18c:	9278      	ld.w      	r3, (r2, 0x60)
 18e:	3ba2      	bseti      	r3, r3, 2
 190:	b278      	st.w      	r3, (r2, 0x60)
}
 192:	783c      	rts

00000194 <I2C_SoftwareResetCmd>:
//I2C ENABLE/DISABLE software reset
//EntryParameter:SWRST_EN/SWRST_DIS
//ReturnValue:NONE
/*************************************************************/
void I2C_SoftwareResetCmd(I2C_EN_DIS_TypeDef EN_DIS)
{
 194:	106a      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
  if (EN_DIS==SWRST_DIS)
 196:	3840      	cmpnei      	r0, 0
  {
    I2C0->CR |= I2C_SWRST;
 198:	9340      	ld.w      	r2, (r3, 0)
 19a:	9278      	ld.w      	r3, (r2, 0x60)
  if (EN_DIS==SWRST_DIS)
 19c:	0804      	bt      	0x1a4	// 1a4 <I2C_SoftwareResetCmd+0x10>
    I2C0->CR |= I2C_SWRST;
 19e:	3ba0      	bseti      	r3, r3, 0
  }
  else
  {
    I2C0->CR &= (~I2C_SWRST);
 1a0:	b278      	st.w      	r3, (r2, 0x60)
  }
}
 1a2:	783c      	rts
    I2C0->CR &= (~I2C_SWRST);
 1a4:	3b80      	bclri      	r3, r3, 0
 1a6:	07fd      	br      	0x1a0	// 1a0 <I2C_SoftwareResetCmd+0xc>

000001a8 <I2C_AcknowledgeConfig>:
//ReturnValue:NONE
/*************************************************************/
void I2C_AcknowledgeConfig(I2C_Ack_TypeDef Ack)
{

  if (Ack == I2C_ACK_NONE)
 1a8:	3840      	cmpnei      	r0, 0
 1aa:	1065      	lrw      	r3, 0	// 1bc <I2C_AcknowledgeConfig+0x14>
 1ac:	0810      	bt      	0x1cc	// 1cc <I2C_AcknowledgeConfig+0x24>
  {
    /* Disable the acknowledgement */
    I2C0->CR &= I2C_AA_NO;
 1ae:	9360      	ld.w      	r3, (r3, 0)
 1b0:	9358      	ld.w      	r2, (r3, 0x60)
 1b2:	3200      	movi      	r2, 0
 1b4:	b358      	st.w      	r2, (r3, 0x60)
  else
  {
    /* Enable the acknowledgement */
    I2C0->CR |= I2C_AA;
  }
}
 1b6:	783c      	rts
	...
    I2C0->CR |= I2C_AA;
 1cc:	9340      	ld.w      	r2, (r3, 0)
 1ce:	9278      	ld.w      	r3, (r2, 0x60)
 1d0:	3ba1      	bseti      	r3, r3, 1
 1d2:	b278      	st.w      	r3, (r2, 0x60)
}
 1d4:	07f1      	br      	0x1b6	// 1b6 <I2C_AcknowledgeConfig+0xe>

000001d6 <I2C_ReceiveData>:
//ReturnValue:I2C0->DAT
/*************************************************************/
U8_T I2C_ReceiveData(void)
{
  /* Return the data present in the DR register */
  return I2C0->DAT;
 1d6:	1361      	lrw      	r3, 0	// 358 <I2C_ReadByte+0x34>
 1d8:	9360      	ld.w      	r3, (r3, 0)
 1da:	237f      	addi      	r3, 128
 1dc:	9300      	ld.w      	r0, (r3, 0)
 1de:	7400      	zextb      	r0, r0
}
 1e0:	783c      	rts

000001e2 <I2C_SendData>:
//ReturnValue:NONE
/*************************************************************/
void I2C_SendData(uint8_t Data)
{
  /* Write in the DR register the data to be sent */
  I2C0->DAT = Data;
 1e2:	127e      	lrw      	r3, 0	// 358 <I2C_ReadByte+0x34>
 1e4:	9360      	ld.w      	r3, (r3, 0)
 1e6:	237f      	addi      	r3, 128
 1e8:	b300      	st.w      	r0, (r3, 0)
}
 1ea:	783c      	rts

000001ec <I2C_Send7bitAddress>:
void I2C_Send7bitAddress(uint8_t Address, I2C_Direction_TypeDef Direction)
{
  /* Clear bit0 (direction) just in case */
  Address &= 0xFE;
  /* Send the Address + Direction */
  I2C0->DAT= Address | Direction;
 1ec:	127b      	lrw      	r3, 0	// 358 <I2C_ReadByte+0x34>
  Address &= 0xFE;
 1ee:	3880      	bclri      	r0, r0, 0
  I2C0->DAT= Address | Direction;
 1f0:	9360      	ld.w      	r3, (r3, 0)
 1f2:	6c40      	or      	r1, r0
 1f4:	237f      	addi      	r3, 128
 1f6:	b320      	st.w      	r1, (r3, 0)
}
 1f8:	783c      	rts

000001fa <I2C_WriteByte>:
//I2C Write byte
//EntryParameter:U8_T addr ,U8_T data
//ReturnValue:NONE
/*************************************************************/
void I2C_WriteByte(U8_T addr, U8_T data)
{
 1fa:	14c2      	push      	r4-r5
	// Write Byte
	I2C0->CR = I2C0->CR | I2C_STA;
 1fc:	1277      	lrw      	r3, 0	// 358 <I2C_ReadByte+0x34>
	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
 1fe:	3408      	movi      	r4, 8
	I2C0->CR = I2C0->CR | I2C_STA;
 200:	9360      	ld.w      	r3, (r3, 0)
 202:	9358      	ld.w      	r2, (r3, 0x60)
 204:	3aa3      	bseti      	r2, r2, 3
 206:	b358      	st.w      	r2, (r3, 0x60)
	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
 208:	935c      	ld.w      	r2, (r3, 0x70)
 20a:	6890      	and      	r2, r4
 20c:	3a40      	cmpnei      	r2, 0
 20e:	0ffd      	bf      	0x208	// 208 <I2C_WriteByte+0xe>
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 210:	3410      	movi      	r4, 16
 212:	9358      	ld.w      	r2, (r3, 0x60)
 214:	6890      	and      	r2, r4
 216:	3a40      	cmpnei      	r2, 0
 218:	0ffd      	bf      	0x212	// 212 <I2C_WriteByte+0x18>

	I2C0->CR = I2C0->CR & (~I2C_SI);
 21a:	9358      	ld.w      	r2, (r3, 0x60)
 21c:	3a84      	bclri      	r2, r2, 4
 21e:	b358      	st.w      	r2, (r3, 0x60)
	I2C0->DAT = I2C_Address<<1;//0xA2;									// Device ID, Write
 220:	3280      	movi      	r2, 128
 222:	608c      	addu      	r2, r3
 224:	34ac      	movi      	r4, 172
 226:	b280      	st.w      	r4, (r2, 0)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 228:	3510      	movi      	r5, 16
 22a:	9398      	ld.w      	r4, (r3, 0x60)
 22c:	6914      	and      	r4, r5
 22e:	3c40      	cmpnei      	r4, 0
 230:	0ffd      	bf      	0x22a	// 22a <I2C_WriteByte+0x30>

	I2C0->CR = I2C0->CR & (~I2C_SI);
 232:	9398      	ld.w      	r4, (r3, 0x60)
 234:	3c84      	bclri      	r4, r4, 4
 236:	b398      	st.w      	r4, (r3, 0x60)
	I2C0->DAT = addr;									// Address
 238:	b200      	st.w      	r0, (r2, 0)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 23a:	3410      	movi      	r4, 16
 23c:	9318      	ld.w      	r0, (r3, 0x60)
 23e:	6810      	and      	r0, r4
 240:	3840      	cmpnei      	r0, 0
 242:	0ffd      	bf      	0x23c	// 23c <I2C_WriteByte+0x42>

	I2C0->CR = I2C0->CR & (~I2C_SI);
 244:	9318      	ld.w      	r0, (r3, 0x60)
 246:	3884      	bclri      	r0, r0, 4
 248:	b318      	st.w      	r0, (r3, 0x60)
	I2C0->DAT = data;								// Data
 24a:	b220      	st.w      	r1, (r2, 0)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 24c:	3110      	movi      	r1, 16
 24e:	9358      	ld.w      	r2, (r3, 0x60)
 250:	6884      	and      	r2, r1
 252:	3a40      	cmpnei      	r2, 0
 254:	0ffd      	bf      	0x24e	// 24e <I2C_WriteByte+0x54>
	I2C0->CR = I2C0->CR & (~I2C_SI);
 256:	9358      	ld.w      	r2, (r3, 0x60)
 258:	3a84      	bclri      	r2, r2, 4
 25a:	b358      	st.w      	r2, (r3, 0x60)
                
	I2C0->CR = I2C0->CR | I2C_STO;
 25c:	9358      	ld.w      	r2, (r3, 0x60)
 25e:	3aa2      	bseti      	r2, r2, 2
 260:	b358      	st.w      	r2, (r3, 0x60)
}
 262:	1482      	pop      	r4-r5

00000264 <I2C_Write_More_Byte>:
//I2C Write MORE byte
//EntryParameter:U8_T addr ,U8_T data,NumByteToWrite(defined by slave )
//ReturnValue:NONE
/*************************************************************/
void I2C_Write_More_Byte(U8_T addr, U8_T *data,U8_T NumByteToWrite)
{
 264:	14c3      	push      	r4-r6
// Write Byte
	I2C0->CR = I2C0->CR | I2C_STA;
 266:	117d      	lrw      	r3, 0	// 358 <I2C_ReadByte+0x34>
	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
 268:	3508      	movi      	r5, 8
	I2C0->CR = I2C0->CR | I2C_STA;
 26a:	9360      	ld.w      	r3, (r3, 0)
 26c:	9398      	ld.w      	r4, (r3, 0x60)
 26e:	3ca3      	bseti      	r4, r4, 3
 270:	b398      	st.w      	r4, (r3, 0x60)
	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
 272:	939c      	ld.w      	r4, (r3, 0x70)
 274:	6914      	and      	r4, r5
 276:	3c40      	cmpnei      	r4, 0
 278:	0ffd      	bf      	0x272	// 272 <I2C_Write_More_Byte+0xe>
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 27a:	3510      	movi      	r5, 16
 27c:	9398      	ld.w      	r4, (r3, 0x60)
 27e:	6914      	and      	r4, r5
 280:	3c40      	cmpnei      	r4, 0
 282:	0ffd      	bf      	0x27c	// 27c <I2C_Write_More_Byte+0x18>

	I2C0->CR = I2C0->CR & (~I2C_SI);
 284:	9398      	ld.w      	r4, (r3, 0x60)
 286:	3c84      	bclri      	r4, r4, 4
 288:	b398      	st.w      	r4, (r3, 0x60)
	I2C0->DAT = I2C_Address<<1;//0xA2;									// Device ID, Write
 28a:	3480      	movi      	r4, 128
 28c:	610c      	addu      	r4, r3
 28e:	35ac      	movi      	r5, 172
 290:	b4a0      	st.w      	r5, (r4, 0)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 292:	3610      	movi      	r6, 16
 294:	93b8      	ld.w      	r5, (r3, 0x60)
 296:	6958      	and      	r5, r6
 298:	3d40      	cmpnei      	r5, 0
 29a:	0ffd      	bf      	0x294	// 294 <I2C_Write_More_Byte+0x30>

	I2C0->CR = I2C0->CR & (~I2C_SI);
 29c:	93b8      	ld.w      	r5, (r3, 0x60)
 29e:	3d84      	bclri      	r5, r5, 4
 2a0:	b3b8      	st.w      	r5, (r3, 0x60)
	I2C0->DAT = addr;									// Address
 2a2:	b400      	st.w      	r0, (r4, 0)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 2a4:	3510      	movi      	r5, 16
 2a6:	9318      	ld.w      	r0, (r3, 0x60)
 2a8:	6814      	and      	r0, r5
 2aa:	3840      	cmpnei      	r0, 0
 2ac:	0ffd      	bf      	0x2a6	// 2a6 <I2C_Write_More_Byte+0x42>
	I2C0->CR = I2C0->CR & (~I2C_SI);
 2ae:	9318      	ld.w      	r0, (r3, 0x60)
 2b0:	3884      	bclri      	r0, r0, 4
 2b2:	b318      	st.w      	r0, (r3, 0x60)
	while(NumByteToWrite!=0)
 2b4:	3a40      	cmpnei      	r2, 0
 2b6:	080d      	bt      	0x2d0	// 2d0 <I2C_Write_More_Byte+0x6c>
		
	I2C0->DAT = *data;
	data++;// Data
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 2b8:	3110      	movi      	r1, 16
 2ba:	9358      	ld.w      	r2, (r3, 0x60)
 2bc:	6884      	and      	r2, r1
 2be:	3a40      	cmpnei      	r2, 0
 2c0:	0ffd      	bf      	0x2ba	// 2ba <I2C_Write_More_Byte+0x56>
	I2C0->CR = I2C0->CR & (~I2C_SI);
 2c2:	9358      	ld.w      	r2, (r3, 0x60)
 2c4:	3a84      	bclri      	r2, r2, 4
 2c6:	b358      	st.w      	r2, (r3, 0x60)
	NumByteToWrite--;               
	I2C0->CR = I2C0->CR | I2C_STO;
 2c8:	9358      	ld.w      	r2, (r3, 0x60)
 2ca:	3aa2      	bseti      	r2, r2, 2
 2cc:	b358      	st.w      	r2, (r3, 0x60)
}
 2ce:	1483      	pop      	r4-r6
	I2C0->DAT = *data;
 2d0:	8100      	ld.b      	r0, (r1, 0)
 2d2:	b400      	st.w      	r0, (r4, 0)
 2d4:	07f0      	br      	0x2b4	// 2b4 <I2C_Write_More_Byte+0x50>

000002d6 <I2C_WriteByte_Int>:
//I2C Write byte in interruption
//EntryParameter:U8_T addr ,U8_T data
//ReturnValue:NONE
/*************************************************************/
void I2C_WriteByte_Int(U8_T addr, U8_T data)
{
 2d6:	14c2      	push      	r4-r5

	I2C_INTFlag=0;
 2d8:	3200      	movi      	r2, 0
 2da:	1161      	lrw      	r3, 0	// 35c <I2C_ReadByte+0x38>
 2dc:	a340      	st.b      	r2, (r3, 0)

// Write Byte
	I2C0->CR = I2C0->CR | I2C_STA;
 2de:	105f      	lrw      	r2, 0	// 358 <I2C_ReadByte+0x34>
 2e0:	9280      	ld.w      	r4, (r2, 0)
 2e2:	9458      	ld.w      	r2, (r4, 0x60)
 2e4:	3aa3      	bseti      	r2, r2, 3
 2e6:	b458      	st.w      	r2, (r4, 0x60)
//	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
	while(I2C_INTFlag!=1);
 2e8:	8340      	ld.b      	r2, (r3, 0)
 2ea:	3a41      	cmpnei      	r2, 1
 2ec:	0bfe      	bt      	0x2e8	// 2e8 <I2C_WriteByte_Int+0x12>
	I2C_INTFlag=0;
 2ee:	3200      	movi      	r2, 0
 2f0:	a340      	st.b      	r2, (r3, 0)

//	I2C0->CR = I2C0->CR & (~I2C_SI);
	I2C0->DAT = I2C_Address<<1;//0xA2;									// Device ID, Write
 2f2:	3280      	movi      	r2, 128
 2f4:	6090      	addu      	r2, r4
 2f6:	35ac      	movi      	r5, 172
 2f8:	b2a0      	st.w      	r5, (r2, 0)
	while(!I2C_INTFlag);
 2fa:	83a0      	ld.b      	r5, (r3, 0)
 2fc:	3d40      	cmpnei      	r5, 0
 2fe:	0ffe      	bf      	0x2fa	// 2fa <I2C_WriteByte_Int+0x24>
	I2C_INTFlag=0;
 300:	3500      	movi      	r5, 0
 302:	a3a0      	st.b      	r5, (r3, 0)

//	I2C0->CR = I2C0->CR & (~I2C_SI);
	I2C0->DAT = addr;									// Address
 304:	b200      	st.w      	r0, (r2, 0)
	while(!I2C_INTFlag);
 306:	8300      	ld.b      	r0, (r3, 0)
 308:	3840      	cmpnei      	r0, 0
 30a:	0ffe      	bf      	0x306	// 306 <I2C_WriteByte_Int+0x30>
	I2C_INTFlag=0;
 30c:	3000      	movi      	r0, 0
 30e:	a300      	st.b      	r0, (r3, 0)

//	I2C0->CR = I2C0->CR & (~I2C_SI);
	I2C0->DAT = data;									// Data
 310:	b220      	st.w      	r1, (r2, 0)
	while(!I2C_INTFlag);
 312:	8340      	ld.b      	r2, (r3, 0)
 314:	3a40      	cmpnei      	r2, 0
 316:	0ffe      	bf      	0x312	// 312 <I2C_WriteByte_Int+0x3c>
	I2C_INTFlag=0;
 318:	3200      	movi      	r2, 0
 31a:	a340      	st.b      	r2, (r3, 0)

//	I2C0->CR = I2C0->CR & (~I2C_SI);
	I2C0->CR = I2C0->CR | I2C_STO;
 31c:	9478      	ld.w      	r3, (r4, 0x60)
 31e:	3ba2      	bseti      	r3, r3, 2
 320:	b478      	st.w      	r3, (r4, 0x60)
}
 322:	1482      	pop      	r4-r5

00000324 <I2C_ReadByte>:
//I2C Read byte
//EntryParameter:U8_T addr
//ReturnValue:I2C0->DAT
/*************************************************************/
U8_T I2C_ReadByte(U8_T addr)
{
 324:	14c1      	push      	r4

	// Verify
	I2C0->CR = I2C0->CR | I2C_STA;
 326:	106d      	lrw      	r3, 0	// 358 <I2C_ReadByte+0x34>
	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
 328:	3108      	movi      	r1, 8
	I2C0->CR = I2C0->CR | I2C_STA;
 32a:	9360      	ld.w      	r3, (r3, 0)
 32c:	9358      	ld.w      	r2, (r3, 0x60)
 32e:	3aa3      	bseti      	r2, r2, 3
 330:	b358      	st.w      	r2, (r3, 0x60)
	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
 332:	935c      	ld.w      	r2, (r3, 0x70)
 334:	6884      	and      	r2, r1
 336:	3a40      	cmpnei      	r2, 0
 338:	0ffd      	bf      	0x332	// 332 <I2C_ReadByte+0xe>
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 33a:	3110      	movi      	r1, 16
 33c:	9358      	ld.w      	r2, (r3, 0x60)
 33e:	6884      	and      	r2, r1
 340:	3a40      	cmpnei      	r2, 0
 342:	0ffd      	bf      	0x33c	// 33c <I2C_ReadByte+0x18>
	I2C0->CR = I2C0->CR & (~I2C_SI);
 344:	9358      	ld.w      	r2, (r3, 0x60)
 346:	3a84      	bclri      	r2, r2, 4

	I2C0->DAT = I2C_Address<<1;//0xA2;									// Device ID, Write
 348:	3180      	movi      	r1, 128
	I2C0->CR = I2C0->CR & (~I2C_SI);
 34a:	b358      	st.w      	r2, (r3, 0x60)
	I2C0->DAT = I2C_Address<<1;//0xA2;									// Device ID, Write
 34c:	604c      	addu      	r1, r3
 34e:	32ac      	movi      	r2, 172
 350:	b140      	st.w      	r2, (r1, 0)
//	I2C0->CR = I2C0->CR & (~I2C_SI);
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 352:	3410      	movi      	r4, 16
 354:	0406      	br      	0x360	// 360 <I2C_ReadByte+0x3c>
	...
 35e:	0000      	.short	0x0000
 360:	9358      	ld.w      	r2, (r3, 0x60)
 362:	6890      	and      	r2, r4
 364:	3a40      	cmpnei      	r2, 0
 366:	0ffd      	bf      	0x360	// 360 <I2C_ReadByte+0x3c>

	I2C0->DAT = addr;									// Address
 368:	b100      	st.w      	r0, (r1, 0)
	I2C0->CR = (I2C0->CR & (~I2C_SI));
 36a:	9358      	ld.w      	r2, (r3, 0x60)
 36c:	3a84      	bclri      	r2, r2, 4
 36e:	b358      	st.w      	r2, (r3, 0x60)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 370:	3010      	movi      	r0, 16
 372:	9358      	ld.w      	r2, (r3, 0x60)
 374:	6880      	and      	r2, r0
 376:	3a40      	cmpnei      	r2, 0
 378:	0ffd      	bf      	0x372	// 372 <I2C_ReadByte+0x4e>


	I2C0->CR = (I2C0->CR & (~I2C_SI)) | I2C_STA;		// re-start
 37a:	9358      	ld.w      	r2, (r3, 0x60)
 37c:	3a83      	bclri      	r2, r2, 3
 37e:	3a84      	bclri      	r2, r2, 4
 380:	3aa3      	bseti      	r2, r2, 3
 382:	b358      	st.w      	r2, (r3, 0x60)
//	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 384:	3010      	movi      	r0, 16
 386:	9358      	ld.w      	r2, (r3, 0x60)
 388:	6880      	and      	r2, r0
 38a:	3a40      	cmpnei      	r2, 0
 38c:	0ffd      	bf      	0x386	// 386 <I2C_ReadByte+0x62>


	I2C0->DAT = (I2C_Address<<1)+1;//0xA3;									// Device ID, Read
 38e:	32ad      	movi      	r2, 173
 390:	b140      	st.w      	r2, (r1, 0)
	I2C0->CR = I2C0->CR & (~I2C_SI);
 392:	9358      	ld.w      	r2, (r3, 0x60)
 394:	3a84      	bclri      	r2, r2, 4
 396:	b358      	st.w      	r2, (r3, 0x60)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 398:	3010      	movi      	r0, 16
 39a:	9358      	ld.w      	r2, (r3, 0x60)
 39c:	6880      	and      	r2, r0
 39e:	3a40      	cmpnei      	r2, 0
 3a0:	0ffd      	bf      	0x39a	// 39a <I2C_ReadByte+0x76>

	I2C0->CR = (I2C0->CR & (~I2C_SI));
 3a2:	9358      	ld.w      	r2, (r3, 0x60)
 3a4:	3a84      	bclri      	r2, r2, 4
 3a6:	b358      	st.w      	r2, (r3, 0x60)
	while((CSP_I2C_GET_CR(I2C0) & I2C_SI) != I2C_SI);
 3a8:	3010      	movi      	r0, 16
 3aa:	9358      	ld.w      	r2, (r3, 0x60)
 3ac:	6880      	and      	r2, r0
 3ae:	3a40      	cmpnei      	r2, 0
 3b0:	0ffd      	bf      	0x3aa	// 3aa <I2C_ReadByte+0x86>

	I2C0->CR = (I2C0->CR & (~I2C_SI)) | I2C_STO;
 3b2:	9358      	ld.w      	r2, (r3, 0x60)
 3b4:	3a82      	bclri      	r2, r2, 2
 3b6:	3a84      	bclri      	r2, r2, 4
 3b8:	3aa2      	bseti      	r2, r2, 2
 3ba:	b358      	st.w      	r2, (r3, 0x60)

	return I2C0->DAT;
 3bc:	9100      	ld.w      	r0, (r1, 0)
 3be:	7400      	zextb      	r0, r0
}
 3c0:	1481      	pop      	r4

000003c2 <I2C_ReadByte_Int>:
//I2C Read byte in interruption
//EntryParameter:U8_T addr
//ReturnValue:i2c_received_data
/*************************************************************/
U8_T I2C_ReadByte_Int(U8_T addr)
{
 3c2:	14c1      	push      	r4

	I2C_INTFlag=0;
 3c4:	3200      	movi      	r2, 0
 3c6:	1363      	lrw      	r3, 0	// 550 <I2C_Slave_Receive+0x124>
 3c8:	a340      	st.b      	r2, (r3, 0)
	U8_T i2c_received_data;

	// Verify
	I2C0->CR = I2C0->CR | I2C_STA;
 3ca:	1343      	lrw      	r2, 0	// 554 <I2C_Slave_Receive+0x128>
 3cc:	9240      	ld.w      	r2, (r2, 0)
 3ce:	9238      	ld.w      	r1, (r2, 0x60)
 3d0:	39a3      	bseti      	r1, r1, 3
 3d2:	b238      	st.w      	r1, (r2, 0x60)
//	while((CSP_I2C_GET_SR(I2C0) & I2C_MTX_START) != I2C_MTX_START );
	while(!I2C_INTFlag);
 3d4:	8320      	ld.b      	r1, (r3, 0)
 3d6:	3940      	cmpnei      	r1, 0
 3d8:	0ffe      	bf      	0x3d4	// 3d4 <I2C_ReadByte_Int+0x12>

	I2C0->DAT = I2C_Address<<1;//0xA2;									// Device ID, Write
 3da:	3180      	movi      	r1, 128
 3dc:	34ac      	movi      	r4, 172
 3de:	6048      	addu      	r1, r2
 3e0:	b180      	st.w      	r4, (r1, 0)
	I2C_INTFlag=0;
 3e2:	3400      	movi      	r4, 0
 3e4:	a380      	st.b      	r4, (r3, 0)
	while(!I2C_INTFlag);
 3e6:	8380      	ld.b      	r4, (r3, 0)
 3e8:	3c40      	cmpnei      	r4, 0
 3ea:	0ffe      	bf      	0x3e6	// 3e6 <I2C_ReadByte_Int+0x24>

	I2C0->DAT = addr;									// Address
 3ec:	b100      	st.w      	r0, (r1, 0)
	I2C_INTFlag=0;
 3ee:	3000      	movi      	r0, 0
 3f0:	a300      	st.b      	r0, (r3, 0)
	restart=1;
 3f2:	3401      	movi      	r4, 1
 3f4:	1219      	lrw      	r0, 0	// 558 <I2C_Slave_Receive+0x12c>
 3f6:	a080      	st.b      	r4, (r0, 0)
	while(!I2C_INTFlag);
 3f8:	8300      	ld.b      	r0, (r3, 0)
 3fa:	3840      	cmpnei      	r0, 0
 3fc:	0ffe      	bf      	0x3f8	// 3f8 <I2C_ReadByte_Int+0x36>

//	I2C0->CR = I2C0->CR | I2C_STA;						// re-start
	I2C_INTFlag=0;
 3fe:	3000      	movi      	r0, 0
 400:	a300      	st.b      	r0, (r3, 0)
	while(!I2C_INTFlag);
 402:	8300      	ld.b      	r0, (r3, 0)
 404:	3840      	cmpnei      	r0, 0
 406:	0ffe      	bf      	0x402	// 402 <I2C_ReadByte_Int+0x40>

	I2C0->DAT = (I2C_Address<<1)+1;//0xA3;									// Device ID, Read
 408:	30ad      	movi      	r0, 173
 40a:	b100      	st.w      	r0, (r1, 0)
	I2C_INTFlag=0;
 40c:	3000      	movi      	r0, 0
 40e:	a300      	st.b      	r0, (r3, 0)
	while(!I2C_INTFlag);
 410:	8300      	ld.b      	r0, (r3, 0)
 412:	3840      	cmpnei      	r0, 0
 414:	0ffe      	bf      	0x410	// 410 <I2C_ReadByte_Int+0x4e>

	I2C_INTFlag=0;
 416:	3000      	movi      	r0, 0
 418:	a300      	st.b      	r0, (r3, 0)
	while(!I2C_INTFlag);
 41a:	8300      	ld.b      	r0, (r3, 0)
 41c:	3840      	cmpnei      	r0, 0
 41e:	0ffe      	bf      	0x41a	// 41a <I2C_ReadByte_Int+0x58>

	i2c_received_data = I2C0->DAT;
 420:	9100      	ld.w      	r0, (r1, 0)

	I2C0->CR = I2C0->CR | I2C_STO;
 422:	9278      	ld.w      	r3, (r2, 0x60)
 424:	3ba2      	bseti      	r3, r3, 2

//	return I2C0->DAT;
	return i2c_received_data;
 426:	7400      	zextb      	r0, r0
	I2C0->CR = I2C0->CR | I2C_STO;
 428:	b278      	st.w      	r3, (r2, 0x60)
}
 42a:	1481      	pop      	r4

0000042c <I2C_Slave_Receive>:
//I2C slave Receive
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void I2C_Slave_Receive(void)
{
 42c:	14d1      	push      	r4, r15
    uint8_t SR_Value;
	SR_Value=I2C0->SR;
 42e:	120a      	lrw      	r0, 0	// 554 <I2C_Slave_Receive+0x128>
    switch(SR_Value)
 430:	31a0      	movi      	r1, 160
	SR_Value=I2C0->SR;
 432:	9060      	ld.w      	r3, (r0, 0)
 434:	935c      	ld.w      	r2, (r3, 0x70)
    switch(SR_Value)
 436:	7488      	zextb      	r2, r2
 438:	644a      	cmpne      	r2, r1
 43a:	6d03      	mov      	r4, r0
 43c:	0cac      	bf      	0x594	// 594 <I2C_Slave_Receive+0x168>
 43e:	6484      	cmphs      	r1, r2
 440:	0c32      	bf      	0x4a4	// 4a4 <I2C_Slave_Receive+0x78>
 442:	3168      	movi      	r1, 104
 444:	644a      	cmpne      	r2, r1
 446:	0c6b      	bf      	0x51c	// 51c <I2C_Slave_Receive+0xf0>
 448:	6484      	cmphs      	r1, r2
 44a:	0c0b      	bf      	0x460	// 460 <I2C_Slave_Receive+0x34>
 44c:	3160      	movi      	r1, 96
 44e:	644a      	cmpne      	r2, r1
 450:	0c66      	bf      	0x51c	// 51c <I2C_Slave_Receive+0xf0>
		I2C0->CR = I2C0->CR & (~I2C_SI);
		I2CSlaveState = I2C_IDLE;
		break;

		default:
		I2C_SLAVE_CONFIG();                                     //if error，reset I2C
 452:	e0000000 	bsr      	0	// 0 <I2C_SLAVE_CONFIG>
		I2C0->CR = I2C0->CR & (~I2C_SI);
 456:	9440      	ld.w      	r2, (r4, 0)
 458:	9278      	ld.w      	r3, (r2, 0x60)
 45a:	3b84      	bclri      	r3, r3, 4
 45c:	b278      	st.w      	r3, (r2, 0x60)
    }
	return;
 45e:	046a      	br      	0x532	// 532 <I2C_Slave_Receive+0x106>
    switch(SR_Value)
 460:	3180      	movi      	r1, 128
 462:	644a      	cmpne      	r2, r1
 464:	0c04      	bf      	0x46c	// 46c <I2C_Slave_Receive+0x40>
 466:	3190      	movi      	r1, 144
 468:	644a      	cmpne      	r2, r1
 46a:	0bf4      	bt      	0x452	// 452 <I2C_Slave_Receive+0x26>
        if ( I2CSlaveState == I2C_WR_STARTED )
 46c:	113c      	lrw      	r1, 0	// 55c <I2C_Slave_Receive+0x130>
 46e:	8141      	ld.b      	r2, (r1, 0x1)
 470:	3a46      	cmpnei      	r2, 6
 472:	0886      	bt      	0x57e	// 57e <I2C_Slave_Receive+0x152>
			if(RdIndex==0)
 474:	8140      	ld.b      	r2, (r1, 0)
 476:	3a40      	cmpnei      	r2, 0
 478:	115a      	lrw      	r2, 0	// 560 <I2C_Slave_Receive+0x134>
 47a:	085d      	bt      	0x534	// 534 <I2C_Slave_Receive+0x108>
				I2C_Data_Adress=I2C0->DAT;
 47c:	3080      	movi      	r0, 128
 47e:	600c      	addu      	r0, r3
 480:	9000      	ld.w      	r0, (r0, 0)
 482:	7400      	zextb      	r0, r0
 484:	a200      	st.b      	r0, (r2, 0)
				I2C_St_Adress=I2C_Data_Adress;
 486:	8240      	ld.b      	r2, (r2, 0)
 488:	7488      	zextb      	r2, r2
 48a:	1117      	lrw      	r0, 0	// 564 <I2C_Slave_Receive+0x138>
 48c:	a040      	st.b      	r2, (r0, 0)
				RdIndex++;
 48e:	8140      	ld.b      	r2, (r1, 0)
 490:	2200      	addi      	r2, 1
 492:	7488      	zextb      	r2, r2
 494:	a140      	st.b      	r2, (r1, 0)
				I2C0->CR = I2C0->CR | I2C_AA;
 496:	9358      	ld.w      	r2, (r3, 0x60)
 498:	3aa1      	bseti      	r2, r2, 1
             I2C0->CR = I2C0->CR | I2C_AA_NO;
 49a:	b358      	st.w      	r2, (r3, 0x60)
		I2C0->CR = I2C0->CR & (~I2C_SI);
 49c:	9358      	ld.w      	r2, (r3, 0x60)
 49e:	3a84      	bclri      	r2, r2, 4
 4a0:	b358      	st.w      	r2, (r3, 0x60)
		break;
 4a2:	0448      	br      	0x532	// 532 <I2C_Slave_Receive+0x106>
    switch(SR_Value)
 4a4:	31b8      	movi      	r1, 184
 4a6:	644a      	cmpne      	r2, r1
 4a8:	0c25      	bf      	0x4f2	// 4f2 <I2C_Slave_Receive+0xc6>
 4aa:	6484      	cmphs      	r1, r2
 4ac:	0c1d      	bf      	0x4e6	// 4e6 <I2C_Slave_Receive+0xba>
 4ae:	31a8      	movi      	r1, 168
 4b0:	644a      	cmpne      	r2, r1
 4b2:	0c04      	bf      	0x4ba	// 4ba <I2C_Slave_Receive+0x8e>
 4b4:	31b0      	movi      	r1, 176
 4b6:	644a      	cmpne      	r2, r1
 4b8:	0bcd      	bt      	0x452	// 452 <I2C_Slave_Receive+0x26>
		RdIndex=0;
 4ba:	1149      	lrw      	r2, 0	// 55c <I2C_Slave_Receive+0x130>
 4bc:	3100      	movi      	r1, 0
 4be:	a220      	st.b      	r1, (r2, 0)
		I2CSlaveState = I2C_RD_STARTED;
 4c0:	3107      	movi      	r1, 7
 4c2:	a221      	st.b      	r1, (r2, 0x1)
		WrIndex = I2C_St_Adress;
 4c4:	1128      	lrw      	r1, 0	// 564 <I2C_Slave_Receive+0x138>
 4c6:	8120      	ld.b      	r1, (r1, 0)
 4c8:	7444      	zextb      	r1, r1
 4ca:	a222      	st.b      	r1, (r2, 0x2)
		if(WrIndex<BUFSIZE)
 4cc:	8202      	ld.b      	r0, (r2, 0x2)
 4ce:	31ff      	movi      	r1, 255
 4d0:	6442      	cmpne      	r0, r1
 4d2:	0fe2      	bf      	0x496	// 496 <I2C_Slave_Receive+0x6a>
			I2C0->DAT= I2CWrBuffer[WrIndex];
 4d4:	8242      	ld.b      	r2, (r2, 0x2)
 4d6:	1125      	lrw      	r1, 0	// 568 <I2C_Slave_Receive+0x13c>
 4d8:	6084      	addu      	r2, r1
 4da:	8240      	ld.b      	r2, (r2, 0)
 4dc:	3180      	movi      	r1, 128
 4de:	7488      	zextb      	r2, r2
 4e0:	604c      	addu      	r1, r3
 4e2:	b140      	st.w      	r2, (r1, 0)
 4e4:	07d9      	br      	0x496	// 496 <I2C_Slave_Receive+0x6a>
    switch(SR_Value)
 4e6:	31c0      	movi      	r1, 192
 4e8:	644a      	cmpne      	r2, r1
 4ea:	0c4c      	bf      	0x582	// 582 <I2C_Slave_Receive+0x156>
 4ec:	31c8      	movi      	r1, 200
 4ee:	644a      	cmpne      	r2, r1
 4f0:	0bb1      	bt      	0x452	// 452 <I2C_Slave_Receive+0x26>
		if ( I2CSlaveState == I2C_RD_STARTED )
 4f2:	105b      	lrw      	r2, 0	// 55c <I2C_Slave_Receive+0x130>
 4f4:	8221      	ld.b      	r1, (r2, 0x1)
 4f6:	3947      	cmpnei      	r1, 7
 4f8:	0843      	bt      	0x57e	// 57e <I2C_Slave_Receive+0x152>
			if(WrIndex+1<BUFSIZE)
 4fa:	8202      	ld.b      	r0, (r2, 0x2)
 4fc:	31fd      	movi      	r1, 253
 4fe:	6405      	cmplt      	r1, r0
 500:	0809      	bt      	0x512	// 512 <I2C_Slave_Receive+0xe6>
				 I2C0->DAT= I2CWrBuffer[WrIndex+1];
 502:	8222      	ld.b      	r1, (r2, 0x2)
 504:	101a      	lrw      	r0, 0	// 56c <I2C_Slave_Receive+0x140>
 506:	6040      	addu      	r1, r0
 508:	8120      	ld.b      	r1, (r1, 0)
 50a:	3080      	movi      	r0, 128
 50c:	7444      	zextb      	r1, r1
 50e:	600c      	addu      	r0, r3
 510:	b020      	st.w      	r1, (r0, 0)
            WrIndex++;
 512:	8222      	ld.b      	r1, (r2, 0x2)
 514:	2100      	addi      	r1, 1
 516:	7444      	zextb      	r1, r1
 518:	a222      	st.b      	r1, (r2, 0x2)
 51a:	07be      	br      	0x496	// 496 <I2C_Slave_Receive+0x6a>
        RdIndex=0;
 51c:	1030      	lrw      	r1, 0	// 55c <I2C_Slave_Receive+0x130>
 51e:	3200      	movi      	r2, 0
 520:	a140      	st.b      	r2, (r1, 0)
		I2C0->CR = I2C0->CR | I2C_AA;
 522:	9358      	ld.w      	r2, (r3, 0x60)
 524:	3aa1      	bseti      	r2, r2, 1
 526:	b358      	st.w      	r2, (r3, 0x60)
		I2C0->CR = I2C0->CR & (~I2C_SI);
 528:	9358      	ld.w      	r2, (r3, 0x60)
 52a:	3a84      	bclri      	r2, r2, 4
 52c:	b358      	st.w      	r2, (r3, 0x60)
        I2CSlaveState = I2C_WR_STARTED;
 52e:	3306      	movi      	r3, 6
 530:	a161      	st.b      	r3, (r1, 0x1)
}
 532:	1491      	pop      	r4, r15
				if(I2C_Data_Adress<BUFSIZE)
 534:	8200      	ld.b      	r0, (r2, 0)
 536:	31ff      	movi      	r1, 255
 538:	6442      	cmpne      	r0, r1
 53a:	0c1d      	bf      	0x574	// 574 <I2C_Slave_Receive+0x148>
					I2CRdBuffer[I2C_Data_Adress]= I2C0->DAT;
 53c:	3080      	movi      	r0, 128
 53e:	600c      	addu      	r0, r3
 540:	8220      	ld.b      	r1, (r2, 0)
 542:	108c      	lrw      	r4, 0	// 570 <I2C_Slave_Receive+0x144>
 544:	6050      	addu      	r1, r4
 546:	9000      	ld.w      	r0, (r0, 0)
 548:	7400      	zextb      	r0, r0
 54a:	a100      	st.b      	r0, (r1, 0)
 54c:	0414      	br      	0x574	// 574 <I2C_Slave_Receive+0x148>
	...
 572:	0000      	.short	0x0000
				I2C_Data_Adress++;
 574:	8220      	ld.b      	r1, (r2, 0)
 576:	2100      	addi      	r1, 1
 578:	7444      	zextb      	r1, r1
 57a:	a220      	st.b      	r1, (r2, 0)
 57c:	078d      	br      	0x496	// 496 <I2C_Slave_Receive+0x6a>
             I2C0->CR = I2C0->CR | I2C_AA_NO;
 57e:	9358      	ld.w      	r2, (r3, 0x60)
 580:	078d      	br      	0x49a	// 49a <I2C_Slave_Receive+0x6e>
		I2C0->CR = I2C0->CR | I2C_AA_NO;
 582:	9358      	ld.w      	r2, (r3, 0x60)
 584:	b358      	st.w      	r2, (r3, 0x60)
		I2C0->CR = I2C0->CR & (~I2C_SI);
 586:	9358      	ld.w      	r2, (r3, 0x60)
 588:	3a84      	bclri      	r2, r2, 4
 58a:	b358      	st.w      	r2, (r3, 0x60)
		I2CSlaveState = DATA_NACK;
 58c:	3205      	movi      	r2, 5
 58e:	1067      	lrw      	r3, 0	// 5a8 <I2C_Slave_Receive+0x17c>
		I2CSlaveState = I2C_IDLE;
 590:	a341      	st.b      	r2, (r3, 0x1)
		break;
 592:	07d0      	br      	0x532	// 532 <I2C_Slave_Receive+0x106>
		I2C0->CR = I2C0->CR | I2C_AA;
 594:	9358      	ld.w      	r2, (r3, 0x60)
 596:	3aa1      	bseti      	r2, r2, 1
 598:	b358      	st.w      	r2, (r3, 0x60)
		I2C0->CR = I2C0->CR & (~I2C_SI);
 59a:	9358      	ld.w      	r2, (r3, 0x60)
 59c:	3a84      	bclri      	r2, r2, 4
 59e:	b358      	st.w      	r2, (r3, 0x60)
		I2CSlaveState = I2C_IDLE;
 5a0:	3200      	movi      	r2, 0
 5a2:	1062      	lrw      	r3, 0	// 5a8 <I2C_Slave_Receive+0x17c>
 5a4:	07f6      	br      	0x590	// 590 <I2C_Slave_Receive+0x164>
 5a6:	0000      	bkpt
 5a8:	00000000 	.long	0x00000000
